/**
 * 实验三
 */
import java.util.Arrays;
import javax.swing.JOptionPane;
public class T3E03 {

public static void main(String[] args) {

	Mobile mobile1 = new Mobile("China Mobile", "E365",1780);
	Mobile mobile2 = new Mobile("China Mobile", "M330",1450);
	Mp3Player player1 = new Mp3Player("Meizo X3", 256, 399);
	Mp3Player player2 = new Mp3Player("Meizo E5", 512, 580);
	Mp3Player player3 = new Mp3Player("Xlive XM MP3 Play", 256, 930);
	Product[] products={ mobile1, mobile2, player1, player2, player3};
	Arrays.sort( products );
	String text = "";
	for(int index = 0; index < products.length; index++)
		text += products[index].toString()+"\n";

	JOptionPane.showMessageDialog(null,"The products are:\n\n" +
		text + "\nThere are "+ Product.getCount() + " products." );

	}
}